<%@page import="java.rmi.Remote"%>
<%@ page language="java" import="java.util.*,mySql.*" pageEncoding="utf-8"%>
<%@ page import="show_shop.*" %>
<%@ page import="java.sql.PreparedStatement"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page import="java.sql.Connection"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>delete_order</title>
  
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
		
		<%
		
		
			 String login_name="root";
			String login_password="2014121167";
			String driverClass="com.mysql.jdbc.Driver";
			String url="jdbc:mysql://localhost:3306/test";
			Connection con=null;
			PreparedStatement pst=null;
			int rs;
				
			user_bean delete_order=new user_bean();	
			delete_order=(user_bean)session.getAttribute("delete_order");
			DBConnection dbcon=new DBConnection(driverClass,url,login_password,login_name);
				try
   			{
   					con=dbcon.getConnection();
   					pst=con.prepareStatement("delete from all_user_buy where user_name="+"'"+delete_order.getUsername()+"'"+"and user_password="+"'"+delete_order.getPassword()+"'");			
   					rs=pst.executeUpdate();
   					System.out.println("ok");
   					
   					response.setHeader("refresh", "2;URL="+"http://localhost:8080/practise/jsp/manage_order.jsp");
   					out.print("删除成功！");
   			}
   			catch (Exception e) {
				e.getStackTrace();
			}	
			
			
	 %>
		
		
		
		
		
  </body>
</html>
